import QtQuick 2.0
import QtQuick.Layouts 1.3

Item {
    property alias a_atuo: p8r_AcheckBox_auto
    property alias a_manual: p8r_AcheckBox_manual
    property alias a_channelFollow: p8r_AcheckBox_channelFollow
    property alias a_systemFollow: p8r_AcheckBox_systemFollow
    property alias a_QJudge: p8r_AcheckBox_QJudge
    property alias a_PFJudge: p8r_AcheckBox_PFJudge

    property alias b_atuo: p8r_BcheckBox_auto
    property alias b_manual: p8r_BcheckBox_manual
    property alias b_channelFollow: p8r_BcheckBox_channelFollow
    property alias b_systemFollow: p8r_BcheckBox_systemFollow
    property alias b_QJudge: p8r_BcheckBox_QJudge
    property alias b_PFJudge: p8r_BcheckBox_PFJudge

    property var checkBoxArray_A:[a_atuo, a_manual,a_channelFollow,a_systemFollow,a_QJudge,a_PFJudge]
    property var checkBoxArray_B:[b_atuo, b_manual,b_channelFollow,b_systemFollow,b_QJudge,b_PFJudge]

    Rectangle {
        id: columnLayoutA
        width: parent.width*0.45
        height: parent.height*0.9
        color: "#6692e8bc"
        anchors.left: parent.left
        anchors.leftMargin: parent.width*0.03
        anchors.topMargin: parent.height/15
        anchors.top: parent.top
        radius: 6

        Text {
            id:p8r_textA
            text: qsTr("A通道：")
            font.pixelSize: parent.height/13
            color: "#40FFFF"
        }
        Rectangle{
            id: rowA
            anchors.left: parent.left
            width: parent.width
            anchors.bottom: parent.bottom
            anchors.top: p8r_textA.bottom
            color: "#00000000"
            property real checkboxFontPointsize: 25*main_screen.minSize
            ColumnLayout{
                id: p8r_ACheckBox
                width: parent.width*0.5
                height: parent.height
                EXC_Normal_CheckBoxSytle{
                    id: p8r_AcheckBox_auto
                    text: qsTr("自动方式")
                    transformOrigin: Item.Left
                    textSize:parent.parent.checkboxFontPointsize
                }
                EXC_Normal_CheckBoxSytle{
                    id: p8r_AcheckBox_manual
                    text: qsTr("手动方式")
                    transformOrigin: Item.Left
                    textSize:parent.parent.checkboxFontPointsize
                }
                EXC_Normal_CheckBoxSytle{
                    id: p8r_AcheckBox_channelFollow
                    text: qsTr("通道跟踪")
                    transformOrigin: Item.Left
                    textSize:parent.parent.checkboxFontPointsize
                }
                EXC_Normal_CheckBoxSytle{
                    id: p8r_AcheckBox_systemFollow
                    text: qsTr("系统电压跟踪")
                    transformOrigin: Item.Left
                    textSize:parent.parent.checkboxFontPointsize
                }
                EXC_Normal_CheckBoxSytle{
                    id: p8r_AcheckBox_QJudge
                    text: qsTr("恒Q控制")
                    transformOrigin: Item.Left
                    textSize:parent.parent.checkboxFontPointsize
                }
                EXC_Normal_CheckBoxSytle{
                    id: p8r_AcheckBox_PFJudge
                    text: qsTr("恒PF控制")
                    transformOrigin: Item.Left
                    textSize:parent.parent.checkboxFontPointsize
                }
            }

            GridLayout{
                id:p8r_ABtn1
                width: parent.width*0.5
                height: parent.height
                rows: 6
                columns: 2
                flow: GridLayout.TopToBottom
                anchors.left: p8r_ACheckBox.right
                EXC_Normal_BtnUncheckStyle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    nameText: qsTr("投入")
                    onClicked: {
//                        console.log($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'A套手动方式退出\''))
                        $modbusInterface.sl_modbusWriteImpulse(212)
//                        $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'A套手动方式退出\''))
                    }
                }
                EXC_Normal_BtnUncheckStyle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    nameText: qsTr("投入")
                    onClicked: {
                        $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'A套手动方式投入\''))
                    }
                }
                EXC_Normal_BtnUncheckSecret_programmerStyle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    nameText: qsTr("投入")
                    onClicked: {
                        $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'A套通道跟踪投入\''))
                    }
                }
                EXC_Normal_BtnUncheckStyle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    nameText: qsTr("投入")
                    onClicked: {
                        $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'A套US跟踪投入\''))
                    }
                }
                EXC_Normal_BtnUncheckStyle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    nameText: qsTr("投入")
                    onClicked: {
                        $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'A套恒Q投入\''))
                    }
                }
                EXC_Normal_BtnUncheckStyle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    nameText: qsTr("投入")
                    onClicked: {
                        $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'A套恒PF投入\''))
                    }
                }
                Rectangle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    color: "#007ad7d1"
                }
                Rectangle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    color: "#007ad7d1"
                }
                EXC_Normal_BtnUncheckSecret_programmerStyle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    nameText: qsTr("退出")
                    onClicked: {
                        $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'A套通道跟踪退出\''))
                    }
                }
                EXC_Normal_BtnUncheckStyle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    nameText: qsTr("退出")
                    onClicked: {
                        $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'A套US跟踪退出\''))
                    }
                }
                EXC_Normal_BtnUncheckStyle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    nameText: qsTr("退出")
                    onClicked: {
                        $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'A套恒Q退出\''))
                    }
                }
                EXC_Normal_BtnUncheckStyle{
                    Layout.preferredWidth: parent.width*0.47
                    Layout.preferredHeight: parent.height*0.1
                    nameText: qsTr("退出")
                    onClicked: {
                        $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'A套恒PF退出\''))
                    }
                }
            }

        }
    }

    Rectangle {
            id: columnLayoutB
            width: parent.width*0.45
            height: parent.height*0.9
            color: "#6692e8bc"
            anchors.left: columnLayoutA.right
            anchors.leftMargin: parent.width*0.04
            anchors.topMargin: parent.height/15
            anchors.top: parent.top
            radius: 6

            Text {
                id:p8r_textB
                text: qsTr("B通道：")
                font.pixelSize: parent.height/13
                color: "#40FFFF"
            }

            Rectangle{
                id: row
                anchors.left: parent.left
                width: parent.width
                anchors.bottom: parent.bottom
                anchors.top: p8r_textB.bottom
                color: "#00000000"
                property real checkboxFontPointsize: 25*main_screen.minSize
                ColumnLayout{
                    id: p8r_BCheckBox
                    width: parent.width*0.5
                    height: parent.height
                    EXC_Normal_CheckBoxSytle{
                        id: p8r_BcheckBox_auto
                        text: qsTr("自动方式")
                        transformOrigin: Item.Left
                        textSize:parent.parent.checkboxFontPointsize
                    }
                    EXC_Normal_CheckBoxSytle{
                        id: p8r_BcheckBox_manual
                        text: qsTr("手动方式")
                        transformOrigin: Item.Left
                        textSize:parent.parent.checkboxFontPointsize
                    }
                    EXC_Normal_CheckBoxSytle{
                        id: p8r_BcheckBox_channelFollow
                        text: qsTr("通道跟踪")
                        transformOrigin: Item.Left
                        textSize:parent.parent.checkboxFontPointsize
                    }
                    EXC_Normal_CheckBoxSytle{
                        id: p8r_BcheckBox_systemFollow
                        text: qsTr("系统电压跟踪")
                        transformOrigin: Item.Left
                        textSize:parent.parent.checkboxFontPointsize
                    }
                    EXC_Normal_CheckBoxSytle{
                        id: p8r_BcheckBox_QJudge
                        text: qsTr("恒Q控制")
                        transformOrigin: Item.Left
                        textSize:parent.parent.checkboxFontPointsize
                    }
                    EXC_Normal_CheckBoxSytle{
                        id: p8r_BcheckBox_PFJudge
                        text: qsTr("恒PF控制")
                        transformOrigin: Item.Left
                        textSize:parent.parent.checkboxFontPointsize
                    }
                }


                GridLayout{
                    id:p8r_BBtn1
                    width: parent.width*0.5
                    height: parent.height
                    rows: 6
                    columns: 2
                    flow: GridLayout.TopToBottom
                    anchors.left: p8r_BCheckBox.right
                    EXC_Normal_BtnUncheckStyle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        nameText: qsTr("投入")
                        onClicked: {
                            $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'B套手动方式退出\''))
                        }
                    }
                    EXC_Normal_BtnUncheckStyle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        nameText: qsTr("投入")
                        onClicked: {
                            $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'B套手动方式投入\''))
                        }
                    }
                    EXC_Normal_BtnUncheckSecret_programmerStyle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        nameText: qsTr("投入")
                        onClicked: {
                            $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'B套通道跟踪投入\''))
                        }
                    }
                    EXC_Normal_BtnUncheckStyle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        nameText: qsTr("投入")
                        onClicked: {
                            $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'B套US跟踪投入\''))
                        }
                    }
                    EXC_Normal_BtnUncheckStyle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        nameText: qsTr("投入")
                        onClicked: {
                            $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'B套恒Q投入\''))
                        }
                    }
                    EXC_Normal_BtnUncheckStyle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        nameText: qsTr("投入")
                        onClicked: {
                            $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'B套恒PF投入\''))
                        }
                    }
                    Rectangle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        color: "#007ad7d1"
                    }
                    Rectangle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        color: "#007ad7d1"
                    }
                    EXC_Normal_BtnUncheckSecret_programmerStyle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        nameText: qsTr("退出")
                        onClicked: {
                            $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'B套通道跟踪退出\''))
                        }
                    }
                    EXC_Normal_BtnUncheckStyle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        nameText: qsTr("退出")
                        onClicked: {
                            $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'B套US跟踪退出\''))
                        }
                    }
                    EXC_Normal_BtnUncheckStyle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        nameText: qsTr("退出")
                        onClicked: {
                            $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'B套恒Q退出\''))
                        }
                    }
                    EXC_Normal_BtnUncheckStyle{
                        Layout.preferredWidth: parent.width*0.47
                        Layout.preferredHeight: parent.height*0.1
                        nameText: qsTr("退出")
                        onClicked: {
                            $modbusInterface.sl_modbusWriteImpulse($sqlMcDefine.qml_queryTableOnce('SELECT dec FROM 写命令 WHERE define='+'\'B套恒PF退出\''))
                        }
                    }
                }
            }
    }
}



/*##^##
Designer {
    D{i:0;autoSize:true;height:480;width:640}
}
##^##*/
